From: Juergen Gross Date: Wed, 13 Jan 2021 13:00:20 +0000 (+0100) Subject: tools/xenstore: add reading global state for live update X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~1089 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=e7217f0b69a87043797da21eda3bc37fd57115fe;p=xen.git tools/xenstore: add reading global state for live update Add reading the global state for live update. Signed-off-by: Juergen Gross Acked-by: Julien Grall Reviewed-by: Paul Durrant Acked-by: Wei Liu --- diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c index 3bced9e39e..d94b558e99 100644 --- a/tools/xenstore/xenstored_control.c +++ b/tools/xenstore/xenstored_control.c @@ -536,6 +536,7 @@ void lu_read_state(void) head = (void *)head + sizeof(*head) + head->length) { switch (head->type) { case XS_STATE_TYPE_GLOBAL: + read_state_global(ctx, head + 1); break; case XS_STATE_TYPE_CONN: break; diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index 4d88aeba3d..60e98104ad 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -2512,6 +2512,15 @@ const char *dump_state_nodes(FILE *fp, const void *ctx) return dump_state_node_tree(fp, path); } +void read_state_global(const void *ctx, const void *state) +{ + const struct xs_state_global *glb = state; + + sock = glb->socket_fd; + + domain_init(glb->evtchn_fd); +} + /* * Local variables: * mode: C diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h index c7567eaf0b..ac9fe1559e 100644 --- a/tools/xenstore/xenstored_core.h +++ b/tools/xenstore/xenstored_core.h @@ -265,6 +265,8 @@ const char *dump_state_node_perms(FILE *fp, struct xs_state_node *sn, const struct xs_permissions *perms, unsigned int n_perms); +void read_state_global(const void *ctx, const void *state); + #endif /* _XENSTORED_CORE_H */ /*